package icloud.com.myapplication.ui.activity;

import android.app.Dialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.Toast;

import icloud.com.myapplication.R;

public class MyActivity extends AppCompatActivity {

    private static final String TAG = "Activity";

    Dialog mDialog;

    GridView mGridView;

    BaseAdapter mBaseAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);
        log("onCreate");
        findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MyActivity.this, SecondActivity.class));
            }
        });
        Intent intent = getIntent();
        if (intent != null && intent.getScheme() != null)
            Toast.makeText(getApplicationContext(), intent.getScheme(), Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void onResume() {
        super.onResume();
        log("onResume");
    }

    @Override
    protected void onStart() {
        super.onStart();
        log("onStart");
    }

    @Override
    protected void onPause() {
        super.onPause();
        log("onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        log("onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        log("onDestroy");
    }

    private void log(String methodName) {
        Log.d(TAG, MyActivity.class.getSimpleName() + "---" + methodName + "--");
    }
}
